#! /usr/bin/python
import os
import glob
import string

def getTrialTimesN(filenum, dir):
    factor = 0;
    if (dir == "12"):
        factor = 125
    elif (dir == "24"):
        factor = 125
    elif (dir == "48"):
        factor = 125
    elif (dir == "96"):
        factor = 125
    elif (dir == "192"):
        factor = 125
    return str(filenum * factor)

def getTrialTimesS(filenum, dir):
    factor = 0;
    if (dir == "12"):
        factor = 50
    elif (dir == "24"):
        factor = 125
    elif (dir == "48"):
        factor = 125
    elif (dir == "96"):
        factor = 125
    elif (dir == "192"):
        factor = 125
    return str(filenum * factor)

def countForEachDirectory():
    dirs = sorted([f for f in os.listdir(os.getcwd()) if os.path.isdir(os.path.join(os.getcwd(), f))], key=lambda x: int(x))
    print "-----------------------------------------------"
    print "Directory    multi-phase    naive "
    print "-----------------------------------------------"
    for dir in dirs:
        sfiles = glob.glob(dir + '/?S*')
        nfiles = glob.glob(dir + '/?N*')
        print dir + "          " + getTrialTimesS(len(sfiles), dir) + "          " + getTrialTimesN(len(nfiles), dir)    
    print "-----------------------------------------------"

countForEachDirectory()


